## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
## Highcharts (www.highcharts.com) is a Highsoft software product which is
## not free for commercial and Governmental use
##
## Attaching package: 'highcharter'
## The following object is masked _by_ '.GlobalEnv':
##
## stars
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Loading required package: TTR
p <- ggplot(sp, aes(Err, Dens, color = Asteroid)) +
geom_point() +
theme_bw()
ggplotly(p)
library(highcharter)
hchart(sp, "point", hcaes(x = Err, y = Dens, group = Asteroid))
hchart(sp, "line", hcaes(x = Err, y = Dens, group = Asteroid))
#NGC4472 Galaxy
hc<- hchart(gal2, type = "scatter", hcaes(radius,surf_mag),
name = "Radius and Surface Mag of NGC4472 Galaxy",
showInLegend = TRUE
)
hc
fig <- plot_ly(fireball, x = ~Altitude_km, y = ~Velocity_km_s, z = ~Total_Radiated_Energy, marker = list(color = "blue"), showscale = TRUE )
fif <- fig %>% layout(scene = list(xaxis = list(title = "Altitude Km"),
yaxis = list(title = "Velocity km/s"),
zaxis = list(title = "Total Radiated Energy (J)")))
fig
## No trace type specified:
## Based on info supplied, a 'scatter3d' trace seems appropriate.
## Read more about this trace type -> https://plot.ly/r/reference/#scatter3d
## No scatter3d mode specifed:
## Setting the mode to markers
## Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: Ignoring 618 observations
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
## Warning: 'scatter3d' objects don't have these attributes: 'showscale'
## Valid attributes include:
## 'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'meta', 'hoverlabel', 'stream', 'transforms', 'uirevision', 'x', 'y', 'z', 'text', 'texttemplate', 'hovertext', 'hovertemplate', 'mode', 'surfaceaxis', 'surfacecolor', 'projection', 'connectgaps', 'line', 'marker', 'textposition', 'textfont', 'hoverinfo', 'error_x', 'error_y', 'error_z', 'xcalendar', 'ycalendar', 'zcalendar', 'scene', 'idssrc', 'customdatasrc', 'metasrc', 'xsrc', 'ysrc', 'zsrc', 'textsrc', 'texttemplatesrc', 'hovertextsrc', 'hovertemplatesrc', 'textpositionsrc', 'hoverinfosrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'
The Bubble Plot below is a vital ploy in understanding how Galaxies are observed through data. Here using plotly, we hage created an interactive bubble plot. our X is the Rmag which is the total red band magnitude, which is the inverted logarithmic measure of the galaxies brightness. The y is the difference between total and aperture magnitude in the R band. In other words, it is a rough measure of the size of the galaxy. the number below the coordinates of each bubble is the obect number ie the number the galaxy is classified as
The variable that effects the size of each bubble is mumax which is the central surface brightness of each galaxy
It is noted that the difference between R mag and mu_mx should be also be an indicator of the galaxy size
red <- plot_ly(combo, x = ~Rmag, y = ~ApDRmag, text = ~Nr, type = "scatter", mode = 'markers',
marker = list(size = ~mumax, opacity = 0.5))
red <- red %>% layout(title = "Magnitude of Logarithmic Brightness Against size of Galaxy",
xaxis = list(showgrid = FALSE),
yaxis = list(showgrid = FALSE))
red
Here we created a new variable where we took the difference in Rmag and mumax as this is also an indicator of a size of each galaxy recorded. we used this new variable as our y to compare and see how reliable it is estimating the size along with x still remaining as our RMag. For the most part, both plots seem to be similar, with a few remaining outliers in the second plot that do not occur in the first plot
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:xts':
##
## first, last
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
combo_n = mutate(combo, Diff_R_Mu = Rmag - mumax )
red2 <- plot_ly(combo_n, x = ~Rmag, y = ~Diff_R_Mu, text = ~Nr, type = "scatter", mode = 'markers', color = "red",marker = list(size = ~mumax, opacity = 0.5))
red2 <- red2 %>% layout(title = "Magnitude of Brightness against Estimated Size",
xaxis = list(showgrid = FALSE),
yaxis = list(showgird = FALSE))
red2
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
ph <- plot_ly(combo_n, x = ~Rmag)
ph <- ph %>% add_lines(y = ~ApDRmag, name = "Difference In Total and Aperture Magnitude in R Band (Estimate of Galaxy Size)")
ph <- ph %>% add_lines(y = ~Diff_R_Mu, name = "Difference in R Magnitude Redshift Band and Central Surface Brightness (Estimated Size)")
ph <- ph %>% layout(
title = "Mesauring Sizes of Galaxy In Association to Redshift Band",
xaxis = list(
rangeselector = list(
)
),
rangeslider(combo_n, start = 16, end = 27)
)
ph
o = "https://astrostatistics.psu.edu/datasets/censor.dat"
p = read.table(o, header = TRUE)
p
## Star Type Teff Ind_Be logN_Be sig_Be Ind_Li logN_Li
## 1 BD-103166 1 5320 1 0.50 NaN 1 NaN
## 2 HD_6434 1 5835 1 1.08 0.10 0 0.80
## 3 HD_9826 1 6212 1 1.05 0.13 1 2.55
## 4 HD_10647 1 6143 1 1.19 0.10 1 2.80
## 5 HD_10697 1 5641 1 1.31 0.13 1 1.96
## 6 HD_12661 1 5702 1 1.13 0.13 0 0.98
## 7 HD_13445 1 5613 0 0.40 NaN 0 -0.12
## 8 HD_16141 1 5801 1 1.17 0.13 1 1.11
## 9 HD_17051 1 6252 1 1.03 0.13 1 2.66
## 10 HD_19994 1 6109 1 0.93 0.12 1 1.99
## 11 HD_22049 1 5073 1 0.77 NaN 0 0.25
## 12 HD_27442 1 4825 0 0.30 NaN 0 -0.47
## 13 HD_38529 1 5674 0 -0.10 NaN 0 0.61
## 14 HD_46375 1 5268 0 0.80 NaN 0 -0.02
## 15 HD_52265 1 6103 1 1.25 0.11 1 2.88
## 16 HD_75289 1 6143 1 1.36 NaN 1 2.85
## 17 HD_82943 1 6016 1 1.27 NaN 1 2.51
## 18 HD_92799 1 5821 1 1.19 0.11 1 1.34
## 19 HD_95128 1 5924 1 1.23 0.11 1 1.83
## 20 HD_108147 1 6248 1 0.99 0.10 1 2.33
## 21 HD_114762 1 5884 1 0.82 0.11 1 2.20
## 22 HD_117176 1 5560 1 0.86 0.13 1 1.88
## 23 HD_120136 1 6339 0 0.25 NaN 1 NaN
## 24 HD_121504 1 6075 1 1.33 0.11 1 2.65
## 25 HD_130322 1 5392 1 0.95 0.13 0 0.13
## 26 HD_134987 1 5776 1 1.22 0.11 0 0.74
## 27 HD_143761 1 5853 1 1.11 0.12 1 1.46
## 28 HD_145675 1 5311 0 0.65 NaN 0 0.03
## 29 HD_169830 1 6299 0 -0.40 NaN 0 1.16
## 30 HD_179949 1 6260 1 1.08 0.10 1 2.65
## 31 HD_187123 1 5845 1 1.08 0.12 1 1.21
## 32 HD_192263 1 4947 0 0.90 NaN 0 -0.39
## 33 HD_195019 1 5842 1 1.15 0.12 1 1.47
## 34 HD_202206 1 5752 1 1.04 0.11 1 1.04
## 35 HD_209458 1 6117 1 1.24 0.11 1 2.70
## 36 HD_210277 1 5532 1 0.91 0.13 0 0.30
## 37 HD_217014 1 5804 1 1.02 0.12 1 1.30
## 38 HD_217107 1 5646 1 0.96 0.13 0 0.40
## 39 HD_222582 1 5843 1 1.14 0.11 0 0.59
## 40 HD_870 2 5447 1 0.80 0.15 0 0.20
## 41 HD_1461 2 5768 1 1.14 0.13 0 0.51
## 42 HD_1581 2 5956 1 1.15 0.11 1 2.37
## 43 HD_3823 2 5948 1 1.02 0.12 1 2.41
## 44 HD_4391 2 5878 1 0.75 0.11 0 1.09
## 45 HD_7570 2 6140 1 1.17 0.10 1 2.91
## 46 HD_10700 2 5344 1 0.83 0.11 0 0.41
## 47 HD_14412 2 5368 1 0.80 0.11 0 0.44
## 48 HD_20010 2 6275 1 1.01 0.10 1 2.13
## 49 HD_20766 2 5733 0 -0.09 NaN 0 0.97
## 50 HD_20794 2 5444 1 0.91 0.11 0 0.52
## 51 HD_20807 2 5843 1 0.36 0.11 0 1.07
## 52 HD_23249 2 5074 0 0.15 NaN 1 1.24
## 53 HD_23484 2 5176 0 0.70 NaN 0 0.40
## 54 HD_26965A 2 5126 1 0.76 0.13 0 0.17
## 55 HD_30495 2 5768 1 1.16 0.11 1 2.44
## 56 HD_36435 2 5479 1 0.99 0.12 1 1.67
## 57 HD_38858 2 5752 1 1.02 0.11 1 1.64
## 58 HD_43162 2 5633 1 1.08 0.11 1 2.34
## 59 HD_43834 2 5594 1 0.94 0.11 1 2.30
## 60 HD_69830 2 5410 1 0.79 0.11 0 0.47
## 61 HD_72673 2 5242 1 0.70 0.13 0 0.48
## 62 HD_74576 2 5000 1 0.70 0.31 1 1.72
## 63 HD_76151 2 5803 1 1.02 0.11 1 1.88
## 64 HD_85117 2 6167 1 1.11 0.11 1 2.64
## 65 HD_189567 2 5765 1 1.06 0.10 0 0.82
## 66 HD_192310 2 5069 0 0.60 NaN 0 0.20
## 67 HD_211415 2 5890 1 1.12 0.10 1 1.92
## 68 HD_222335 2 5260 1 0.66 0.22 0 0.31
The Plot below is obtained from a Dataset from stellar Astronomy. The dataset contains 39 known stars to host plants and 29 in a control sample. here is an interactive 3D chat that includes x as the stellar surface temperature of each start, y as the amount of beryllium, and z as the amount of lithium in each star. From the data, we see that the amount of beryllium in each star is correlated to the surface temperature of each star as this also gives us a broader idea of the mass in each start
Type 1 = Planet Hosting Star Type 2 = Control Sample
Lets go further and assess this correlation
start_3d <- plot_ly(p, x = ~Teff, y = ~logN_Be, z = ~logN_Li,
color = ~Type, colors = c('#BF382A', '#0C4B8E'))
start_3d <-start_3d %>% add_markers()
start_3d <- start_3d %>% layout(scene = list(xaxis = list(title = "Stellar Surface Temperature"),yaxis = list(title = "Logarithmic of Beryllium In Each Star"),
zaxis = list(title = "Logarithmic of Lithium"))
)
start_3d
## Warning: Ignoring 2 observations
new <- plot_ly(data = p, x = ~Teff, y = ~logN_Be, type = "scatter",
mode = 'markers', symbol = ~Type, symbols = c("circle", "x"),
color = I("blue"), marker = list(size = 10))
new <- new %>% layout(title = "Stellar Surface Temperature Against Logarthmic Be" )
new
Histogram of Stellar Surface Temperature
his <- plot_ly(data = p,alpha = 0.6)
his <- his %>% add_histogram(x = ~Teff)
his <- his %>% add_histogram(x = ~Teff)
his <- his %>% layout(barmode = "overlay")
his <- his %>% layout(title = "Histogram of Stellar Surface Temperature")
his
line <- plot_ly(p, x = ~Teff, y = ~logN_Be, z =~logN_Li, type = "scatter3d", mode = "lines",
opacity = 1, line = list(width = 6, color = ~Type, reverscale = FALSE))
line <- line %>% layout(title = " 3D Line Plot of Planetary Hosting Stars")
line
sp_ice = subset(sp, Dens > 1 & Dens < 2)
sp_ice
## Asteroid Dens Err
## 10 45_Eugenia 1.20 0.40
## 11 87_Sylvia 1.62 0.30
## 12 121_Hermione 1.96 0.34
## 14 253_Mathilde 1.30 0.20
## 17 762_Pulcova 1.80 0.80
## 20 2000_DP107 1.62 1.05
## 21 2000_UG11 1.47 0.95
## 24 1313_Berna 1.21 0.25
box_q <- plot_ly(sp_ice, x = ~Asteroid, y = ~Dens,
type = "bar")
box_q <- box_q %>% layout(title = "Densities of Asteroids less than 2 grams (solid Ice Material")
box_q
sp_rocky = subset(sp, Dens >= 3)
box_t <- plot_ly(sp_rocky, x = ~Asteroid, y = ~Dens,
type = "bar")
box_t <- box_t %>% layout(title = "Densities of Asteroids less than greater or equal to 3,(Rocky Material)")
box_t